package br.unisinos.service;

import java.util.List;

import br.unisinos.dao.BaseDAO;

public abstract class BaseServiceImpl <POJO, DAO extends BaseDAO<POJO>> implements BaseService<POJO>{
	
	private DAO dao;

	public DAO getDao() {
		return dao;
	}

	public void setDao(DAO dao) {
		this.dao = dao;
	}
	
	public POJO insert(POJO pojo){
		return getDao().insert(pojo);
	}
	
	public POJO findById(POJO pojo){
		return getDao().findById(pojo);
	}
	
	public void update(POJO pojo){
		getDao().update(pojo);
	}
	
	public void delete(POJO pojo){
		getDao().delete(pojo);
	}
	
	public List<POJO> findAll(){
		return getDao().findAll();
	}

	public POJO findLast(){
		return getDao().findLast();
	}

	public int count(){
		return getDao().count();
	}
	
	public POJO findFirst(){
		return getDao().findFirst();
	}

	
	
}
